In a video distribution system that consists of video source devices (e.g., Blu-ray disc players, set-top boxes, camcorders, desktop PC, mobile devices, and so on) video encoder devices, video decoder devices and video display devices (e.g., computer or television displays, projectors, etc.) that operate independently of each other with a data connection between them, a method to synchronize the video playback frame rate of the decoder with the incoming video frame rate of the source must be implemented. This is required because the video source device has a timing device (i.e. a “clock”) used to generate video at a specific frame rate and the video decoder has a different and independent timing device that plays video at a specific frame rate that is nominally the same as the frame rate of the source, but in reality is slightly different. This is because these hardware timing devices have a tolerance (e.g. plus or minus 100 parts per million for a crystal oscillator that nominally runs at 148.5 MHz) so that the actual clock frequency differs very slightly from one device to the other. Due to these device differences, over the course of a few seconds to a few minutes the timing device in the video source will drift relative to the timing source in the video decoder. Some video distribution systems include a multi-conductor cable to connect the video encoder to the video decoder. These cables carry a specific signal on one of the conductors called a “Genlock” or generator lock signal. This signal allows the video decoder to perform clock corrections in order to keep the decoder's frame rate exactly synchronous with the video frame rate of the encoder. Generally, the encoder's frame rate is synchronized to that of the video source by a pixel clock signal sent from the source to the encoder's video input port.
Depending on a video source or a type of video content, the frame rate may typically range from approximately 24 Hz to approximately 60 Hz or 0 Hz in case of static images.
The capabilities of a television display or computer monitor can be queried over a high definition multimedia interface (HDMI) link by a video source or video decoder device that is directly connected to that display using a well known standard communication protocol called Extended Display Identification Data (EDID). The EDID information provided by a display enables the source or decoder to determine what frame rates and resolutions that display supports. This allows the source or decoder to present video information in a form that can be consumed by the display. Once the source or decoder determines that the display can correctly consume its video content, it will begin to play that content at a frame rate and resolution supported by the display. When this is done, the video display will synchronize itself with the directly connected video source or decoder device as long as a pixel clock signal is provided as required by the HDMI standard. The pixel clock tells the display exactly when to draw each pixel on the display.
If the decoder device is a personal computer, or a device that supports add-in cards, the hardware timing device in that decoder might be a crystal oscillator on a motherboard that drives a high resolution timer in the main CPU on that motherboard. This high resolution timer might be used by an operating system that implements a preemptive multitasking method that allows many independent threads of software to run in parallel. One of these software threads could be responsible for reading or capturing frames or sub-frames of video and sending that video data across a “bus”, or multi-conductor interface that the add-in cards are plugged into in order to write the video data into memory on the add-in card. A sub-frame of video is a fraction of a frame that could, for example, be one fourth of a frame, or one eighth of a frame or some other sub-frame fraction of a frame. The add-in card can be designed so that it stores one full frame of video in its memory. Sometimes, the frame rate of the source material will change. For example, the initial menu screens that are shown at the beginning of a Blu-ray movie that allow a user to select language options or give a user the ability to jump to a particular scene in the movie may be generated at 60 frames per second, while the actual movie content could be recorded at 24 frames per second. Since the video add-in card could be playing video at 60 frames per second, the card could request new video data before the video source is ready to provide new video data if the new data is only being generated at 24 frames per second. Without any information to display and without some method to synchronize the video rendering process on the card with the rate of video generation by the host, the video card might display incorrect data, leading to objectionable video artifacts. This can occur even if the resolution of the video material does not change. The add-in card will generally have its own independent video frame clock that it uses to synchronize processing on the card. If this is a free-running clock, the video playback can become de-synchronized from the clock on the motherboard, so that when new frames of video at a new frame rate start to be sent to the card, they may start playing at a random position on the display leading to video that is vertically shifted. This de-synchronization can also occur if there is an interruption of processing within the host's pre-emptive multitasking operating system. The video card needs to play video at a continuous rate in order to refresh the image on the display to prevent the screen from going blank. If the host becomes excessively loaded, the host may not be able to respond in a timely manner to a request from the card for a new frame or subframe of video. This situation is referred to as an “under-run” because the video card is starved of data and its video playback buffers are under-filled. Alternatively, de-synchronization can occur if the video encoder and the video decoder are connected by an Internet Protocol (IP) network rather than a simple point-to-point multi-conductor cable. The IP network may experience congestion or packet loss that could cause the decoding device to be starved of data. As a result of any of these events, user experience and viewing comfort could be significantly diminished.
Therefore there exists a need for a robust solution that prevents frame drops, video shifting, video stuttering and other video artifacts while keeping the video source and the video decoding device in synchronization with each other.
This application is related to U.S. application Ser. No. 14/837,317, entitled: A CONTROL MECHANISM FOR VIDEO OUTPUT, filed 27 Aug. 2015, now U.S. Pat. No. 9,807,408, which is incorporated by reference for all purposes into this specification.